
import turtle
# turtle.bgcolor("black")

t = turtle.Pen()
t.penup()


colorList01 = ["red", "black", "blue", "green", "orange", "purple"]

sides = 4


for m in range(100):
    t.forward(m * 4)
    position = t.position()
    heading = t.heading()

    for n in range(int(m/2)):
        t.pendown()
        t.pencolor(colorList01[n%sides])
        t.forward(2*n)
        t.right(360/sides - 2)
        t.penup()

    t.setx(position[0])
    t.sety(position[1])
    t.setheading(heading)
    t.left(360/sides + 2)

